var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var LocationSchema = new Schema({
  name: String,
  // IMPORTANT
  // Specify coordinates in this order: “longitude, latitude.”
  loc: {
    type: [Number],
    index: '2d',
    sparse: true
  }
});

module.exports = mongoose.model('Location', LocationSchema);
